
package cartagows.wsframework.wssecurity.policy.model;

import org.apache.neethi.PolicyComponent;

import cartagows.wsframework.wssecurity.policy.SP11Constants;
import cartagows.wsframework.wssecurity.policy.SP12Constants;
import cartagows.wsframework.wssecurity.policy.SPConstants;

import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;


public class SecurityContextToken extends Token {

    boolean requireExternalUriRef;    
    boolean sc10SecurityContextToken;
    
    public SecurityContextToken(int version) {
        setVersion(version);
    }

    public boolean isRequireExternalUriRef() {
        return requireExternalUriRef;
    }

    public void setRequireExternalUriRef(boolean requireExternalUriRef) {
        this.requireExternalUriRef = requireExternalUriRef;
    }

    public boolean isSc10SecurityContextToken() {
        return sc10SecurityContextToken;
    }
    public void setSc10SecurityContextToken(boolean sc10SecurityContextToken) {
        this.sc10SecurityContextToken = sc10SecurityContextToken;
    }

    public QName getName() {
        if ( version == SPConstants.SP_V12) {
            return SP12Constants.SECURITY_CONTEXT_TOKEN;
        } else {
            return SP11Constants.SECURITY_CONTEXT_TOKEN;
        }   
    }

    public PolicyComponent normalize() {

    	throw new UnsupportedOperationException("TODO Sanka");
    }

    public void serialize(XMLStreamWriter writer) throws XMLStreamException {

    	throw new UnsupportedOperationException("TODO Sanka");
    }

}
